<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="ielcss/style.css" rel="stylesheet" type="text/css" media="all" />
<title>Iel-Editor</title>
<script language="javascript" type="text/javascript">
/*by Yokit QQ:182860914*/
var URLParams = new Object() ;
var aParams = window.location.search.substr(1).split("&") ;
for(i=0 ; i < aParams.length ; i++){
	var aParam = aParams[i].split("=");
	URLParams[aParam[0]] = aParam[1];
}

var $ = function(id) {return "string" == typeof id ? window.document.getElementById(id) : id;};

var MyIEL_Editor,objEditor,oMyIframe,objPanel,oLinkField;
var Editor_Width=parseInt(URLParams["iWidth"]);
var Editor_Height=parseInt(URLParams["iHeight"]);
var Editor_FScreen=parseInt(URLParams["FScreen"]);
var Editor_Panel=parseInt(URLParams["Panel"]);
var Identifier="SOIUSLKGOSFEIULLU";

window.onload=function(){
	MyIEL_Editor=new IEL_Editor("MyIEL_Editor");
};

String.prototype.trim = function(){
	return this.replace(/(^[\s　]*)|([\s　]*$)/g, "");
};

String.prototype.delrn = function(){
	return this.replace(/\r\n|\n/gi,"");
};

String.prototype.replaceall = function(a,b){
	return this.replace(new RegExp(a, "gm"),b);
};

function IEL_Editor(instance_name){
	if(typeof(instance_name)=="undefined"){
        alert("ERROR: 没有创建IEL_Editor实例.");
        return false;
    }else{
        this.instance_name=instance_name;
    }
	this.sCurrMode="EDIT";
	this.oSeleData=new Object();
	//this.isST=false;
	this.isIE=this.isMSIE();
	if(isNaN(Editor_Panel)){
		this.isPanel = false;
	}else{
		this.isPanel = Editor_Panel == 0 ? true : false;
	}
	objEditor=$(this.instance_name+"_Frame");
	objPanel=$("MyIelEidtor_Panel");
	
	objEditor.contentWindow.document.designMode="On";
	
	if(this.isIE){
		objEditor.contentWindow.document.onreadystatechange=function(){
			if (objEditor.contentWindow.document.readyState!="complete") {return;}
			oLinkField = parent.document.getElementsByName(URLParams["xHtml"])[0];
			
			if(typeof(oLinkField)!="undefined" && typeof(MyIEL_Editor)!="undefined"){
				objEditor.contentWindow.document.body.innerHTML=oLinkField.value;
				MyIEL_Editor.prepareSubmit();
			}
		};
	}else{
		if(typeof(objEditor)!="undefined"){
			oLinkField = parent.document.getElementsByName(URLParams["xHtml"])[0];
			
			if(typeof(oLinkField)!="undefined" && typeof(objEditor.contentWindow.document.body)!="undefined"){
				objEditor.contentWindow.document.body.innerHTML=oLinkField.value;
				this.prepareSubmit();
			}
		}
	}
	
	if(Editor_FScreen){
		$("btnFullScreen").className="i14x";
		$("btnFullScreen").getElementsByTagName("a")[0].onclick=window.parent.Revert;
	}
	
	if(!Editor_FScreen){
		var oIframes=window.parent.document.getElementsByTagName("iframe");
		if(oIframes.length>0){
			for(var i=0;i<oIframes.length;i++){
				if(oIframes[i].contentWindow.Identifier==Identifier && isNaN(oIframes[i].contentWindow.Editor_FScreen)){
					oMyIframe = oIframes[i];
					if(!oMyIframe.id){
						if(oMyIframe.uniqueID){
							oMyIframe.id=oMyIframe.uniqueID;
						}else{
							oMyIframe.setAttribute("id", "EDCID_"+new Date().getTime());
						}
					}
				}
			}
			if(!oMyIframe){	alert("无法确定编辑器所属IFRAME！");}
		}
		oIframes = null;
	}
	
	/*<FF HTMLElement>*/
	if(typeof(objEditor.contentWindow.HTMLElement) != "undefined" && !window.opera)
	{
		objEditor.contentWindow.HTMLElement.prototype.__defineGetter__("outerHTML",function(){
			var a = this.attributes, str = "<" + this.tagName, i = 0;
			for (; i < a.length; i++)
			if (a[i].specified)
			str += " " + a[i].name + '="' + a[i].value + '"';
			if (!this.canHaveChildren)
			return str + " />";
			return str + ">" + this.innerHTML + "</" + this.tagName + ">";
		});
		objEditor.contentWindow.HTMLElement.prototype.__defineSetter__("outerHTML", function(s){
			var r = this.ownerDocument.createRange();
			r.setStartBefore(this);
			var df = r.createContextualFragment(s);
			this.parentNode.replaceChild(df, this);
			return s;
		});
		objEditor.contentWindow.HTMLElement.prototype.__defineGetter__("canHaveChildren", function(){
			return ! /^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(this.tagName.toLowerCase());
		});
		objEditor.contentWindow.HTMLElement.prototype.__defineGetter__("innerText", function(){
			var anyString = "";
			var childS = this.childNodes;
			for(var i=0; i<childS.length; i++)
			{ 
				if(childS[i].nodeType==1)
				anyString += childS[i].tagName=="BR" ? "\n" : childS[i].innerText;
				else if(childS[i].nodeType==3)
				anyString += childS[i].nodeValue;
			}
			return anyString; 
		});
	}
	/*</FF HTMLElement>*/
	/*by Yokit QQ:182860914*/
	
}

IEL_Editor.prototype.isMSIE = function (){
    if(typeof(document.all)=="object"){
        return true;
    }else{
        return false;
    }
};

/*IEL_Editor Selection*/
IEL_Editor.prototype.seleSave = function(){
	objEditor.contentWindow.focus();
	var doc = objEditor.contentWindow.document;
	if(this.isIE){
		if (!doc) return;
		var b = doc.selection;
		var c;
		if(b){
			c = b.createRange();
			odoc=c.parentElement().ownerDocument || c.parentElement().document;
			if(odoc!=doc){
				c = null;
			}
		};
		this.oSeleData = c;
		doc=odoc=b=c=null;
	}else{
		var s=objEditor.contentWindow.getSelection();
		var a=s.getRangeAt(0);
		b=a.endContainer;
		odoc=b.parentNode.ownerDocument || b.parentNode.document;
		if(odoc!=doc){
			s = null;
		}
		this.oSeleData = s;
		doc=odoc=b=s=null;
	}
};
IEL_Editor.prototype.seleRestore = function(){
	objEditor.contentWindow.focus();
	if(this.oSeleData){
		//this.IsSeleClocked = true;
		if(this.isIE){	
			try{
				this.oSeleData.select();
				return this.oSeleData;
			}catch(e){};
		}else{
			this.oSeleData.getRangeAt(0);
			try{
				//var sel=objEditor.contentWindow.getSelection();
				this.oSeleData.addRange(this.oSeleData.getRangeAt(0));
			}catch(e){};
			return this.oSeleData.getRangeAt(0);
		}
		//this.IsSeleClocked = false;
	}
};
/*End Selection*/

IEL_Editor.prototype.setFixId = function(s,i){
	var a=s.substr(0,s.indexOf(">")+1);
	var b=a;
	b=b.replace(">"," >");
	b=b.replace(/id ?= ?"?\S+"?/gi,"id=\""+i+"\"");
	if(b.indexOf(i)<0){b=b.replace(" >"," id=\""+i+"\">");}
	return s.replace(a,b);
};

IEL_Editor.prototype.eventPosi = function(ev){
	var posi = new Array();
	if(this.isIE){
		posi[0] = window.event.clientX;
		posi[1] = window.event.clientY;
	}else{
		posi[0] = ev.clientX;
		posi[1] = ev.clientY;
	}
	return posi;
};

IEL_Editor.prototype.setPanel = function (url,arrwh,arrxy){
	if(this.isPanel){
		objPanel.src = url;
		objPanel.style.width = arrwh[0];
		objPanel.style.height = arrwh[1];
		objPanel.style.left = arrxy[0];
		objPanel.style.top = arrxy[1];
		objPanel.style.display = "";
	}else{
		arrxy[0]+=22;
		arrxy[1]+=160;
		this.setPanelx(url,arrwh,arrxy);
	}
};

IEL_Editor.prototype.setPanelx = function (url,arrwh,arrxy){
	var scid="MyIelEidtor_Panelx";
	var shref = window.location.href;
	var sloca = shref.split("/");
	var spath = shref.replace(sloca[sloca.length-1],"");
	try{
		var objSfull = window.parent.document.getElementById(scid);
		var sTem = objSfull.src;
	}catch(e){
		var sObjHtml = "<iframe id=\""+scid+"\" style=\"display:none; position: absolute; left: 0px; top: 0px; z-index: 999; border: 2px solid #b6d4ec; border-bottom-color: #809bb0; border-right-color: #809bb0;\" src=\"about:blank\" frameborder=\"0\" marginheight=\"1\" marginwidth=\"1\" width=\"0\" height=\"0\" scrolling=\"no\"></iframe>";
		var newDiv = window.parent.document.createElement("div");
		newDiv.innerHTML=sObjHtml;
		window.parent.document.body.appendChild(newDiv);
		var objSfull = window.parent.document.getElementById(scid);
		sObjHtml=newDiv=null;
	}
	
	objSfull.width = arrwh[0];
	objSfull.height = arrwh[1];
	objSfull.style.left = arrxy[0]+"px";
	objSfull.style.top = arrxy[1]+oMyIframe.offsetTop+"px";
	objSfull.src = spath+url.replace(objPanel.id,scid)+"&iframe="+oMyIframe.id;
	objSfull.style.display = "";
	shref=objSfull=null;
}

IEL_Editor.prototype.doTextFormat = function (command, optn, evnt){
	
	this.seleSave();
	var posi = this.eventPosi(this.isIE ? null : arguments.callee.caller.arguments[0]);
    if((command=="ForeColor") || (command=="HiliteColor")){
        this.getPallete(command, optn, evnt, posi);
    }else if(command=="CreateLink"){
		this.setPanel("xdialog/hyperlink.html?obj=" + objPanel.id,[250,110],[posi[0],posi[1]]);
	}else if((command=="FontSize") || (command=="FontName")){
		this.setSeleStyle(command, optn, evnt);
	}else{
        if(objEditor.contentWindow.document.queryCommandEnabled(command)){
              objEditor.contentWindow.document.execCommand(command, false, optn);
              return true;
          }else return false;
    }
    
};

IEL_Editor.prototype.getPallete = function (command, optn, evnt, posi) {
	if(command=="HiliteColor" || command=="ForeColor"){
		this.setPanel("xdialog/colorpanel.html?action="+command+"&obj=" + objPanel.id,[272,158],[posi[0],posi[1]]);
	}
};

IEL_Editor.prototype.setColor = function(command, color, evnt){
	this.setSeleStyle(command, color, evnt);
    return true;
};

IEL_Editor.prototype.setSeleStyle = function (command, fontstyle_, evnt){
	var oRange=this.seleRestore();
	var scid="iel_editor_selestyle",more=2;
	var oNode;
	if(this.isIE){
		oNode=oRange.parentElement();
		if(!oNode){return null;}
		if(oNode.innerText.delrn().trim()==oRange.text.delrn().trim()){
			var stem=oNode.outerHTML;
		}else{
			var stem=oRange.htmlText;
			var oNew=objEditor.contentWindow.document.createElement("span");
			oNew.setAttribute("id",scid+"_1");
			oNew.innerHTML=stem;
		}
		stem=stem.delrn().trim();
		var n = stem.indexOf("<")+1 > 0 ? stem.indexOf("<") : stem.indexOf("<");
		if(n!=0 || oNew){
			n=0;
			stem=stem.replace(/< ?/g,"<").replace(/ ?>/g,">");
			stem.replace(/(p|ul|li|br|dl|dd|dt|div|center)>/gi,function(s){n++; return null;});
			if(n==0){
				oNode.innerHTML=oNode.innerHTML.delrn().replace(stem,oNew.outerHTML);
			}else{
				n=0;
				oNew=objEditor.contentWindow.document.createElement("div");
				oNew.setAttribute("id",scid+"_1");
				oNew.innerHTML=stem;
				oNode.innerHTML=oNode.innerHTML.delrn().replace(stem,function(s){n++; return oNew.outerHTML;});
				if(oNode==objEditor.contentWindow.document.body){ return null;}
				if(n==0){oRange.pasteHTML(oNew.outerHTML);}
			}
		}else{
			if(oNode==objEditor.contentWindow.document.body){ return null;}
			var suse=this.setFixId(stem,scid+"_1");
			oNode.outerHTML=suse;
		}
	}else{
		oNode=oRange.startContainer;
		if(oNode.parentNode.innerText.delrn().trim()==oRange.toString().delrn().trim()){
			var stem=oNode.parentNode.outerHTML;
		}else{
			oNode=objEditor.contentWindow.document.createElement("div");
			oNode.setAttribute("id",scid+"_1");
			try{oRange.surroundContents(oNode);	}catch(e){return null;}
			var stem=oNode.innerHTML;
		}
		stem=stem.delrn().trim();
		var n = stem.indexOf("<")+1 > 0 ? stem.indexOf("<") : stem.indexOf("<");
		if(n!=0){
			n=0;
			stem=stem.replace(/< ?/g,"<").replace(/ ?>/g,">");
			stem.replace(/(p|ul|li|br|dl|dd|dt|div|center)>/gi,function(s){n++; return null;});
			if(n==0){oNode.outerHTML=oNode.outerHTML.delrn().replace(/^<div(.+?)<\/div>$/gi,"<span $1</span>");}
		}else{
			var suse=this.setFixId(stem,scid+"_1");
			oNode.outerHTML=suse;
		}
	}
	for(var i=1; i<more; i++){
		oElem=objEditor.contentWindow.document.getElementById(scid+"_"+i);
		if(!oElem){return null;}
		if(n==6){oElem.innerHTML=oElem.innerHTML.replace(/≮/g,"<").replace(/≯/g,">");}
		if(oElem.getAttribute("id", 2)==scid+"_"+i){
			switch (command){
			case "FontSize":
				if(!oElem.style){oElem.setAttribute("style","font-size: 14px;");}
				oElem.style.fontSize = fontstyle_+"px";
				break;
			case "FontName":
				if(!oElem.style){oElem.setAttribute("style","font-family: 宋体;");}
				oElem.style.fontFamily = fontstyle_;
				break;
			case "ForeColor":
				if(!oElem.style){oElem.setAttribute("style","color: #000000;");}
				oElem.style.color = fontstyle_;
				break;
			case "HiliteColor":
				if(!oElem.style){oElem.setAttribute("style","background-color: #FFFFFF;");}
				oElem.style.backgroundColor = fontstyle_;
				break;
			}
			oElem.removeAttribute("id");
			if(this.isIE){
				oRange.moveToElementText(oElem);
				oRange.select();
			}else{
				var oSele=objEditor.contentWindow.getSelection();
				oRange.selectNode(oElem);
				oSele.addRange(oRange);
			}
			//this.isST=true;
			/*by Yokit QQ:182860914*/
		}
	}
	oRange=oSelec=stem=suse=oNode=oElem=null;
};

IEL_Editor.prototype.doPhaseBr = function (){
    var rng=this.isIE ? objEditor.contentWindow.document.selection.createRange() : objEditor.contentWindow.getSelection();
    if(rng!=null){
		var rng_text= this.isIE ? rng.text : rng.getRangeAt(0);
		var rng_prefix = "　　";
		var rng_tmps = this.isIE ? rng_text.split("\n") : rng_text.toString().split("\n");
		var rng_html = "";
		for (i = 0; i < rng_tmps.length; i++) {
		  var rng_tmp = rng_tmps[i].trim();
		  if (rng_tmp.length > 0) {
		  	if(i == rng_tmps.length - 1){
				rng_html += rng_prefix + rng_tmp;
			}else{
				rng_html += rng_prefix + rng_tmp + "<br/>\n";
			}
		  }
		}
		if(this.isIE){
			rng.pasteHTML(rng_html);
		}else{
			objEditor.contentWindow.document.execCommand("insertHTML",false,"<p>"+rng_html+"</p>");
		}
		rng_text=rng_tmps=rng=null;
    }
};


IEL_Editor.prototype.insertTable = function (){
	var posi = this.eventPosi(this.isIE ? null : arguments.callee.caller.arguments[0]);
	this.seleSave();
	this.setPanel("xdialog/inserttable.html?obj=" + objPanel.id,[316,156],[posi[0],posi[1]]);
};

IEL_Editor.prototype.insertImage = function (){
	var posi = this.eventPosi(this.isIE ? null : arguments.callee.caller.arguments[0]);
	this.seleSave();
	this.setPanel("xdialog/images.html?obj=" + objPanel.id,[250,110],[posi[0],posi[1]]);
};

IEL_Editor.prototype.fullScreen = function (){
	this.setPanelx("xdialog/mdfullscreen.html?panel=false&obj=" + objPanel.id,[window.screen.availWidth-160,window.screen.availHeight-160],[80,20]);
};

IEL_Editor.prototype.w3cHTML = function(sHtml,sSign){
	switch (sSign){
	case "TAG":
		sHtml = sHtml.replace(/(<\/?)([a-z\d\:]+)((\s+.+?)?>)/gi,function(s,a,b,c){/*alert("b:"+b); alert("c:"+c);*/if(b.toLowerCase()!="img"){var e=a+b.toLowerCase()+c.toLowerCase();}else{var e=a+b.toLowerCase()+c;} return e;});
		break;
	case "ATT":
		sHtml = sHtml.replace(/( [^\=]*\=)(\s?[^\"\s\>]*)/gi,function(a,b,c,d,e){return (c)?(new RegExp("<[^>]*"+c.replace(/(\^|\(|\)|\[|\]|\{|\}|\?|\-|\\|\/|\||\$)/g,"\\$1")+"[^>]*>","i").test(e))?b+'"'+c+'"':b+c:b});
		break;
	case "REP":
		sHtml = sHtml.replace(/(<a title=\"?iel_editor_selestyle\"?)([^>]+?)>(.+?)(<\/a>)/gi,function(s,a,b,c,d){var e=s.replace(a,"<span"); e=e.replace(d,"</span>"); return e;});
		break;
	}
	return sHtml;
};

IEL_Editor.prototype.FitSetHTML = function(sHtml,sSign){
	switch (sSign){
	case "CODE":
		sHtml = this.w3cHTML(sHtml, "TAG");
		
		sHtml=sHtml.replaceall("&gt;","#gt;");
		sHtml=sHtml.replaceall("&lt;","#lt;");
		sHtml=sHtml.replace(/<\S?(dl|ul|br|div)+[^>]*>/gi,function(s){return s+"↙";});
		sHtml=sHtml.replace(/<\/(p|dd|dt|li|center)+[^>]*>/gi,function(s){return s+"↙";});
		sHtml=sHtml.replaceall(">","&gt;");
		sHtml=sHtml.replaceall("<","&lt;");
		sHtml=sHtml.replaceall("↙","<br/>");

		sHtml=sHtml.replaceall("#gt;","≯");
		sHtml=sHtml.replaceall("#lt;","≮");
		sHtml=sHtml.replaceall("\r\n","");
		sHtml=sHtml.replaceall("\n","");
		break;
	case "EDIT":
		sHtml=sHtml.replaceall("≯","&gt;");
		sHtml=sHtml.replaceall("≮","&lt;");
		sHtml = this.w3cHTML(sHtml, "TAG");
		break;
	}
	return sHtml;
};

IEL_Editor.prototype.setHTML = function(sHtml){
	switch (this.sCurrMode){
	case "CODE":
		//if(this.isST){sHtml = this.w3cHTML(sHtml, "REP");}
		if(this.isIE){
			sHtml = this.w3cHTML(sHtml, "ATT");
			objEditor.contentWindow.document.body.innerText = this.w3cHTML(sHtml, "TAG");
		}else{
			objEditor.contentWindow.document.body.innerHTML = this.FitSetHTML(sHtml,"CODE");
		}
		break;
	case "EDIT":
		try{
			if(this.isIE){
				objEditor.contentWindow.document.body.innerHTML = this.w3cHTML(sHtml, "TAG");
			}else{
				objEditor.contentWindow.document.body.innerHTML = this.FitSetHTML(sHtml,"EDIT");
			}
			return true;
		}catch(e){
			return false;
		}
		break;
	}
};

IEL_Editor.prototype.getHTML = function(){
	var sHTML;
	if(this.sCurrMode=="CODE"){
		sHTML = objEditor.contentWindow.document.body.innerText;
	}else{
		sHTML = objEditor.contentWindow.document.body.innerHTML;
	}
	if (this.sCurrMode!=""){
		if ((sHTML.toLowerCase()=="<p>&nbsp;</p>")||(sHTML.toLowerCase().trim()=="<br>")){
			sHTML = "";
		}
	}
	return sHTML;
};

IEL_Editor.prototype.doSelectAll = function(){
	objEditor.contentWindow.focus();
	if(this.isIE){
		try{
			objEditor.contentWindow.document.execCommand('SelectAll');
		}catch(e){
			cursor=objEditor.contentWindow.document.body.createTextRange();
			var select_ = cursor.duplicate();
			select_.moveStart("character", objEditor.contentWindow.document.body.innerHTML.length);
			select_.setEndPoint("EndToStart", cursor);
			select_.select();
		}
	}else{
		try{
			var oSele = objEditor.contentWindow.getSelection();
			var oRange = objEditor.contentWindow.document.createRange();
			oRange.selectNode(objEditor.contentWindow.document.body);
			oSele.addRange(oRange);
		}catch(e){
		}
	}
};

IEL_Editor.prototype.doResize = function(){
	if(this.isIE){
		objEditor.height=document.body.offsetHeight-85;
	}else{
		objEditor.height=window.innerHeight-85;
	}
};

IEL_Editor.prototype.designModeOn = function(){
	objEditor.contentWindow.document.designMode="On";
	objEditor.contentWindow.document.body.contentEditable="true";
};

IEL_Editor.prototype.designModeOf = function(){
	objEditor.contentWindow.document.designMode="Off";
	objEditor.contentWindow.document.body.contentEditable="false";
};

IEL_Editor.prototype.toggleMode	= function(sMode_){
	for(var i=1; i<=2; i++){
		$("BtnMode_"+i).className="";
	}
	if(sMode_ == "CODE"){
		this.sCurrMode = "CODE";
		var sHtml = objEditor.contentWindow.document.body.innerHTML;
		if(sHtml.toLowerCase().trim()=="<p>&nbsp;</p>" || sHtml.toLowerCase().trim()=="<br>"){
			this.setHTML("");
		}else{
			this.setHTML(sHtml);
		}
		$("MyIelEidtor_Hdiv").getElementsByTagName("div")[0].style.visibility="hidden";
		$("MyIelEidtor_Hdiv").getElementsByTagName("div")[1].style.visibility="hidden";
		$("BtnMode_1").onclick="";
		$("BtnMode_2").onclick=function(){MyIEL_Editor.toggleMode("EDIT");}
		$("BtnMode_1").className="sle";
		sHtml=null;
	}else{
		this.sCurrMode = "EDIT";
		this.setHTML(objEditor.contentWindow.document.body.innerText);
		$("MyIelEidtor_Hdiv").getElementsByTagName("div")[0].style.visibility="visible";
		$("MyIelEidtor_Hdiv").getElementsByTagName("div")[1].style.visibility="visible";
		$("BtnMode_2").onclick="";
		$("BtnMode_1").onclick=function(){MyIEL_Editor.toggleMode("CODE");}
		$("BtnMode_2").className="sle";
	}
};

IEL_Editor.prototype.formatHTML=function(){
	if (this.sCurrMode == "EDIT")
	{
		var temps = new Array();
		var sec = this.isIE ? objEditor.contentWindow.document.selection.createRange() : objEditor.contentWindow.getSelection();
		var tmpText = sec.text;
		var isPart = tmpText != null && tmpText.trim().length > 0;
		isPart = false;
		if (!isPart) {
			var imgs = objEditor.contentWindow.document.images;
			if (imgs != null && imgs.length > 0) {
				for (j = 0; j < imgs.length; j++) {
					var t = document.createElement("IMG");
					//t.alt = imgs[j].alt;
					var reAlt=$("altText").value;
					var nAlt=parseInt(10*Math.random())%2;
					if(reAlt == "图片提示信息"){
						t.alt =  imgs[j].alt;
					}else{
						t.alt =  $("altText").value;
						if(nAlt==1){t.alt = reAlt;}else{t.alt = "(图"+j+")";}
					}
					t.src = imgs[j].src;
					t.width = imgs[j].width;
					t.height = imgs[j].height;
					t.align = imgs[j].align;
					temps[temps.length] = t;
				}
				var imgs_len=imgs.length;
				for (j = 0; j < imgs_len;){
					imgs[0].outerHTML = "<br/>#FormatImgID_" + j + "#<br/>";
					j++;
				}
			}
			var ihtml = objEditor.contentWindow.document.body.innerText;
			ihtml=ihtml.replaceall(">","≯");
			ihtml=ihtml.replaceall("<","≮");
			var html = this._processFormatText(ihtml);
			if (temps != null && temps.length > 0) {
				for (j = 0; j < temps.length; j++) {
					var imghtml = "<center><img src=\"" + temps[j].src + "\" alt=\"" + temps[j].alt + "\" /></center>";
					html = html.replace("<p>　　#FormatImgID_" + j + "#</p>", imghtml);
				}
			}
			html=html.replaceall("≯","&gt;");
			html=html.replaceall("≮","&lt;");
			objEditor.contentWindow.document.body.innerHTML=html;
			$("altText").value="图片提示信息";
			sec=temps=imgs=html=ihtml=null;
		} else {
			var html = this._processFormatText(tmpText);
			sec.pasteHTML(html);
		}
	}else{
		alert( "必须在设计模式下操作！" );
	}
};

IEL_Editor.prototype._processFormatText=function(textContext){
	//var text = this._DBC2SBC(textContext);
	var text = textContext;
	var prefix = "　　";
	var tmps = text.split("\n");
	var html = "";
	for (i = 0; i < tmps.length; i++) {
	  var tmp = tmps[i].trim();
	  if (tmp.length > 0) {
		html += "<p>　　" + tmp + "</p>\n";
	  }
	}
	textContext=text=tmps=null;
	return html;
};

IEL_Editor.prototype._DBC2SBC=function(str){
  var result = "";
  for (var i = 0; i < str.length; i++) {
    code = str.charCodeAt(i);
    if (code >= 65281 && code < 65373 && code != 65292 && code != 65306){
      result += String.fromCharCode(str.charCodeAt(i) - 65248);
    } else {
      result += str.charAt(i);
    }
  }
  return result;
};

IEL_Editor.prototype.prepareSubmit = function (){
	
	if (!oLinkField) {return;}
	var oForm = oLinkField.form;
	if (!oForm) {return;}
	if(this.isIE){
		oForm.attachEvent("onsubmit", this.AttachSubmit);
	}else{
		oForm.addEventListener("submit", this.AttachSubmit);
	}
	oForm=null;
};

IEL_Editor.prototype.AttachSubmit = function (){
	try{
		if (!oLinkField) {return false;}
		var oForm = oLinkField.form;
		if (!oForm) {return false;}
		
		if(MyIEL_Editor.sCurrMode == "CODE"){
			MyIEL_Editor.toggleMode("EDIT");
		}
		
		var htmlCode=objEditor.contentWindow.document.body.innerHTML;
		htmlCode = MyIEL_Editor.w3cHTML(htmlCode, "TAG");
		htmlCode = MyIEL_Editor.w3cHTML(htmlCode, "ATT");
		//if(this.isST){htmlCode = this.w3cHTML(htmlCode, "REP");}
		
		htmlCode = htmlCode.replace(/(<img)([^>]+?[^\/])(>)/gi,function(s,a,b,c){return a+b+" /"+c;});
		if(window.location.port==""){
			htmlCode=htmlCode.replace(new RegExp("http://"+window.location.hostname,"gi"), "");
		}else{
			htmlCode=htmlCode.replace(new RegExp("http://"+window.location.hostname+":"+window.location.port,"gi"), "");
		}
		oLinkField.value=htmlCode;
		htmlCode=null;
		return true;
	}catch(err){
		alert("错误:" + err.description);
		return false;
	}
};

IEL_Editor.prototype.getAbout = function (){
	var posi = this.eventPosi(this.isIE ? null : arguments.callee.caller.arguments[0]);
	this.setPanel("xdialog/about.html?obj=" + objPanel.id,[260,155],[posi[0],posi[1]]);
};
</script>
</head>
<body>
<div id="MyIelEidtor_Hdiv">
  <div class="Toolbar Hdiv_1">
  	<ul>
		<li class="Select__">
			<select class="TBGen" onChange="MyIEL_Editor.doTextFormat('FormatBlock',this[this.selectedIndex].value);this.selectedIndex=0">
			  <option selected>段落样式</option>
			  <option value="<P>">普通</option>
			  <option value="<H1>">标题一</option>
			  <option value="<H2>">标题二</option>
			  <option value="<H3>">标题三</option>
			</select>
			<select class="TBGen" onChange="MyIEL_Editor.doTextFormat('FontName',this[this.selectedIndex].value);this.selectedIndex=0">
			  <option selected>字体</option>
			  <option value="宋体">宋体</option>
			  <option value="黑体">黑体</option>
			  <option value="微软雅黑">雅黑</option>
			  <option value="楷体_GB2312">楷体</option>
			  <option value="仿宋_GB2312">仿宋</option>
              <option value="Verdana">Ver~</option>
              <option value="Arial">Ari~</option>
              <option value="Courier New">Cou~</option>
            </select>
			<select class="TBGen" onChange="MyIEL_Editor.doTextFormat('FontSize',this[this.selectedIndex].value);this.selectedIndex=0">
			  <option selected>字号</option>
			  <option value="10">10px</option>
			  <option value="11">11px</option>
			  <option value="12">12px</option>
              <option value="13">13px</option>
			  <option value="14">14px</option>
			  <option value="15">15px</option>
              <option value="16">16px</option>
              <option value="20">20px</option>
              <option value="22">22px</option>
              <option value="24">24px</option>
			</select>
		</li>
		<li class="i01"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('ForeColor','',event)" title="字体颜色"></a></li>
		<li class="i02"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('HiliteColor','',event)" title="字体背景"></a></li>
		<li class="i03"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('Bold','')" title="粗体"></a></li>
		<li class="i04"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('Italic','')" title="斜体"></a></li>
		<li class="i05"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('Underline','')" title="下划线"></a></li>
		<li class="i06"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('StrikeThrough','')" title="中划线"></a></li>
		<li class="i07"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('Superscript','')" title="上标"></a></li>
		<li class="i08"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('Subscript','')" title="下标"></a></li>
		<li class="mclear"></li>
	</ul>
  </div><!--Hdiv_1-->
  <div class="Toolbar Hdiv_2">
  	<ul>
        <li class="i01"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('JustifyLeft','')" title="左对齐"></a></li>
		<li class="i02"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('JustifyCenter','')" title="居中对齐"></a></li>
		<li class="i03"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('JustifyRight','')" title="右对齐"></a></li>
		<li class="i04"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('JustifyFull','')" title="两端对齐"></a></li>
		<li class="i99"><a href="javascript:void(0)" onClick="MyIEL_Editor.doPhaseBr()" title="换行段落"></a></li>
		<li class="i05"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('Indent','')" title="增加缩进"></a></li>
		<li class="i06"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('Outdent','')" title="减少缩进"></a></li>
		<li class="i07"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('CreateLink','')" title="插入/修改超链接"></a></li>
		<li class="i08"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('Unlink','')" title="取消超链接"></a></li>
		<li class="i09"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('InsertOrderedList','')" title="有序编号"></a></li>
		<li class="i10"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('InsertUnorderedList','')" title="项目符号"></a></li>
		<li class="i11"><a href="javascript:void(0)" onClick="MyIEL_Editor.doTextFormat('InsertHorizontalRule','')" title="插入水平尺"></a></li>
		<li class="i12"><a href="javascript:void(0)" onClick="MyIEL_Editor.insertTable()" title="插入表格"></a></li>
		<li class="i13"><a href="javascript:void(0)" onClick="MyIEL_Editor.insertImage()" title="插入图片"></a></li>
		<li class="i14" id="btnFullScreen"><a href="javascript:void(0)" onClick="MyIEL_Editor.fullScreen()" title="全屏\返回编辑"></a></li>
		<li class="i15"><a href="javascript:void(0)" onClick="MyIEL_Editor.getAbout()" title="关于IEL编辑器"></a></li>
        <script language="javascript" type="text/javascript">
		if(Editor_FScreen){	document.write('<li class="i16"><a href="javascript:void(0)" onclick="MyIEL_Editor.doSelectAll()" title="全部选中"></a></li>');}
		</script>
		<li class="mclear"></li>
	</ul>
  </div>
</div>
<div id="MyIelEidtor_Frame">
	<script language="javascript" type="text/javascript">
		if(typeof(Editor_Width)=="number" && Math.round(Editor_Width) > 50){
			Editor_Width=Math.round(Editor_Width);
		}else{
			Editor_Width="100%";
		}
		if(typeof(Editor_Height)=="number" && Math.round(Editor_Height) > 50){
			Editor_Height=Math.round(Editor_Height);
		}else{
			//Editor_Height="100%";
			if(document.all){
				Editor_Height=document.documentElement.offsetHeight-85;
			}else{
				Editor_Height=window.innerHeight-85;
			}
		}
		document.write('<iframe class="IelEidtorFrame" id="MyIEL_Editor_Frame" src="blank.html" frameborder="0" marginheight="1" marginwidth="1" width="'+Editor_Width+'" scrolling="yes" height="'+Editor_Height+'"></iframe>');
    	/*by Yokit QQ:182860914*/
	</script>
</div>
<div id="MyIelEidtor_Mode">
	<div class="Mode Mode_1"><a href="javascript:void(0)" id="BtnMode_1" onClick="MyIEL_Editor.toggleMode('CODE')">代码</a></div>
	<div class="Mode Mode_2"><a href="javascript:void(0)" id="BtnMode_2" onClick="MyIEL_Editor.toggleMode('EDIT')" class="sle">设计</a></div>
	<div class="Mode Mode_3"><a href="javascript:void(0)" id="BtnMode_3" onClick="MyIEL_Editor.formatHTML()">格式化</a></div>
	<div class="ImgAlt"><input type="text" name="altText" id="altText" value="图片提示信息" maxlength="35" /></div>
	<p class="mclear"></p>
</div>
<iframe id="MyIelEidtor_Panel" style="display:none;" src="blank.html" frameborder="0" marginheight="1" marginwidth="1" width="0" height="0" scrolling="no"></iframe>
</body>
</html>